<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>钻石投票_全部礼物记录</title>
	<link rel="stylesheet" href="__MCSS__/bass.css">
	<link rel="stylesheet" href="__CSS__/font-awesome.css">
    <link rel="stylesheet" href="__JS__/layui/css/layui.css"/>
    <link rel="stylesheet" href="__MCSS__/layui-formadd.css"/>
	<link rel="stylesheet" href="__MCSS__/layui-pageadd.css"/>
	<link rel="stylesheet" href="__MCSS__/public.css"/>
	<link rel="stylesheet" href="__MCSS__/gift_count.css">
	<link rel="stylesheet" href="__MCSS__/layui-add.css">
</head>
<body>

	<div class="gift-count">

		<div class="gift-count-body">
			<!--面包屑-->
			<p class="bread-crumbs-nav"><span class="span1">数据记录</span><i class="fa fa-caret-right"></i><span class="span2">礼物记录</span></p>

			<!--内容区-->
			<div class="gift-main">
				<div class="gift-pay">
					<a href="{:url('order/gifts')}"><div class="gift-pay-list {eq name="type" value="0"}gift-active{/eq}">全部</div></a>
					<a href="{:url('order/gifts',['type'=>1])}"><div class="gift-pay-list {eq name="type" value="1"}gift-active{/eq}">已支付</div></a>
					<a href="{:url('order/gifts',['type'=>2])}"><div class="gift-pay-list {eq name="type" value="2"}gift-active{/eq}">未支付</div></a>
					<div class="gift-sum">礼物：{$total_price}元</div>
				</div>

				<div class="gift-tit">
					<div class="gift-tit-seach">
						<p><input type="text" value="{$keyword}" placeholder="搜索投票人IP/昵称"></p>
						<span>搜索</span>
					</div>
					<div class="gift-tit-day">
						<div data-day="all" class="gift-day-msg {eq name="day" value="all"}gift-day-active{/eq}">全部</div>
                        <div data-day="yestoday" class="gift-day-msg {eq name="day" value="yestoday"}gift-day-active{/eq}">昨日</div>
                        <div data-day="today" class="gift-day-msg {eq name="day" value="today"}gift-day-active{/eq}">今日</div>
                        <div data-day="three" class="gift-day-msg {eq name="day" value="three"}gift-day-active{/eq}">近3日</div>
                        <div data-day="week" class="gift-day-msg {eq name="day" value="week"}gift-day-active{/eq}">近7日</div>
					</div>
					<div class="gift-tit-date">
						<div class="layui-form">
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">日期范围</label>
									<div class="layui-input-inline">
										<input type="text" class="layui-input" id="gift-date-choose" placeholder="请选择时间段">
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>

				<div class="gift-table">
					<div class="gift-table-container">
						<div class="gift-table-tit">
							<ul>
								<li class="gift-tit-li1">活动</li>
								<li class="gift-tit-li2">选手（编号:/名称）</li>
								<li class="gift-tit-li3">时间</li>
								<li class="gift-tit-li4">IP</li>
								<li class="gift-tit-li5">定单号</li>
								<li class="gift-tit-li6">礼物</li>
								<li class="gift-tit-li7">金额</li>
								<li class="gift-tit-li8">状态</li>
							</ul>
						</div>
						<div class="gift-table-body">
							<!-- 全部礼物列表 -->
							<div class="gift-table-pay">
								{volist name="lists" id="vo"}
								<ul>
									<li class="gift-tit-li1"><a href="">{$vo.title}</a></li>
									<li class="gift-tit-li2"><a href=""><img src="{$vo.first_image}" alt="">{$vo.competitor_num}/{$vo.competitor_name}</a></li>
									<li class="gift-tit-li3">{$vo.create_time}</li>
									<li class="gift-tit-li4">{$vo.last_ip}</li>
									<li class="gift-tit-li5">{$vo.order_no}</li>
									<li class="gift-tit-li6">{:htmlspecialchars_decode($vo.gift)} X{$vo.gift_num}</li>
									<li class="gift-tit-li7">￥{$vo.price}</li>
									<li class="gift-tit-li8"><span class="gift-paid">已支付加3票</span></li>
								</ul>
								{/volist}
								<!-- 分页设置 -->
								<div class="gift-page"><div id="gift-page-list"></div></div>
							</div>
							<!-- 已支付列表 -->
							<div class="gift-table-pay gift-none">
								{volist name="lists1" id="vo"}
								<ul>
									<li class="gift-tit-li1"><a href="">{$vo.title}</a></li>
									<li class="gift-tit-li2"><a href=""><img src="{$vo.first_image}" alt="">{$vo.competitor_num}/{$vo.competitor_name}</a></li>
									<li class="gift-tit-li3">{$vo.create_time}</li>
									<li class="gift-tit-li4">{$vo.last_ip}</li>
									<li class="gift-tit-li5">{$vo.order_no}</li>
									<li class="gift-tit-li6">{:htmlspecialchars_decode($vo.gift)} X{$vo.gift_num}</li>
									<li class="gift-tit-li7">￥{$vo.price}</li>
									<li class="gift-tit-li8"><span class="gift-paid">已支付加3票</span></li>
								</ul>
								{/volist}
								<!-- 分页设置 -->
								<div class="gift-page"><div id="gift-page-list1"></div></div>
							</div>
							<!-- 未支付列表 -->
							<div class="gift-table-pay gift-none">
								{volist name="lists2" id="vo"}
								<ul>
									<li class="gift-tit-li1"><a href="">{$vo.title}</a></li>
									<li class="gift-tit-li2"><a href=""><img src="{$vo.first_image}" alt="">{$vo.competitor_num}/{$vo.competitor_name}</a></li>
									<li class="gift-tit-li3">{$vo.create_time}</li>
									<li class="gift-tit-li4">{$vo.last_ip}</li>
									<li class="gift-tit-li5">{$vo.order_no}</li>
									<li class="gift-tit-li6">{:htmlspecialchars_decode($vo.gift)} X{$vo.gift_num}</li>
									<li class="gift-tit-li7">￥{$vo.price}</li>
									<li class="gift-tit-li8"><span class="gift-paid">已支付加3票</span></li>
								</ul>
								{/volist}
								<!-- 分页设置 -->
								<div class="vote-paging" style="margin-top:20px;text-align:right;">
									<div id="pager">
										{$lists|raw}
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>

			</div>



		</div>
	</div>
<script src="__JS__/jquery_v3.3.1.js"></script>
<script src="__JS__/layer/layer.js"></script>
<script src="__JS__/layui/layui.js"></script>
<script src="__MJS__/common.js"></script>
<script type="text/javascript">

	// 选择日期
	$('.gift-day-msg').click(function(){
		$('.gift-day-msg').removeClass('gift-day-active');
		$(this).addClass('gift-day-active').siblings().removeClass('gift-day-active');
        console.log($(this).attr('data-day'));
        var day=$(this).attr('data-day');
        if(day.length<1){
            return false;
        }
        var params = getParams();
        params.day = day;
        var param_array = [];
        Object.keys(params).forEach(function (key) {
            if(key!='btime'){
                param_array.push(key + '=' + params[key]);
            }
        });
        var param_str = '?' + param_array.join('&');
        window.location.href = "/admin/order/gifts.html" + param_str;
	});

	//时间日期
	layui.use('laydate', function(){
		var laydate = layui.laydate;
		laydate.render({
			elem: '#gift-date-choose'
			,range: true
			,done: function(value, date, endDate){
				var params = getParams();
				params.btime = value;
				var param_array = [];
				Object.keys(params).forEach(function (key) {
					if(key!='day'){
						param_array.push(key + '=' + params[key]);
					}
				});
				var param_str = '?' + param_array.join('&');
				window.location.href = "/admin/order/gifts.html" + param_str;
			}
		});
	});

	// 选择查看类型
	$('.gift-pay-list').click(function(){
		var index = $(this).index();
		$('.gift-pay-list').removeClass('gift-active');
		$(this).addClass('gift-active').siblings().removeClass('gift-active');
		$('.gift-table-pay').eq(index).show().siblings().hide();
	});


    /**
     * 搜索
     */
    $('.gift-tit-seach span').click(function(){
        var keyword = $(this).prev('p').find('input').val();
        if(keyword.length<1){
            return false;
        }
        var params = getParams();
        params.keyword = keyword;
        var param_array = [];
        Object.keys(params).forEach(function (key) {
            param_array.push(key + '=' + params[key]);
        });
        var param_str = '?' + param_array.join('&');
        window.location.href = "/admin/order/gifts.html" + param_str;
    });


	//分页
	layui.use('laypage', function(){
		var laypage = layui.laypage;

		laypage.render({
        elem: 'gift-page-list', //注意，这里的 test1 是 ID，不用加 # 号
        count:80, //数据总数，从服务端得到
        layout: ['count', 'prev', 'page', 'next', 'skip'],
        groups:4,
        limit:20,
        jump: function(obj, first) {
            //obj包含了当前分页的所有参数，比如：
            console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
            console.log(obj.limit); //得到每页显示的条数
        	}
    	});
	});

</script>
</body>
</html>